###
 # @Descripttion: 
 # @version: 
 # @Author: Yang jin
 # @Date: 2021-08-25 09:16:30
 # @LastEditors: Yang jin
 # @LastEditTime: 2021-09-01 09:20:55
### 
###
 # @Descripttion: 获取文件目录下所有文件的前K行
 # @version: 
 # @Author: Yang jin
 # @Date: 2021-08-25 07:33:18
 # @LastEditors: Yang jin
 # @LastEditTime: 2021-08-25 07:44:30
### 
###
 # 运行时添加一个参数K
###
root_dir=/workspace/datasets/MAG-GUT/tra-label-mag-gut
files=$(ls $root_dir/split_files/*.sorted)
K=10
K2=`expr $K \* 2`

output=sorted-top$K-test-mag-gut.fa.1000.fragment

for file in $files
do
    head -n ${K2} $file >> $root_dir/$output
done